<div id="sharing-creating">

  <h2>新建分享</h2>
  <hr/>

  <div class="sharing-creating-container">
    <div id="sharing-creating-content">
      <div class="topic row">
        <label class="col col-lg-1 col-md-2 col-sm-2">名称:</label>
        <div class="col-lg-10 col-md-9 col-sm-9">
          <input class="form-control" ng-model="newSharing.name" type="text"/>
        </div>

      </div>

      <div class="content row">
        <label class="col col-lg-1 col-md-2 col-sm-2">内容:</label>
        <div class="col-lg-10 col-md-9 col-sm-9">
          <textarea class="form-control"  markdown-editor ng-model="newSharing.content" rows="8"></textarea>
        </div>

      </div>

      <div class="attachments row">
        <label class="col col-lg-1 col-md-2 col-sm-2">附件:</label>

        <div class="right-attachments col col-lg-10 col-md-9 col-sm-2">

          <button ng-file-select ng-model="uploadingFiles" multiple="true"  class="btn btn-info">添加附件</button>

          <div ng-show="uploading">
            <div ng-repeat="currentUpload in uploadingProgresses">
              <small><em>{{currentUpload.filename}}</em></small>
              <progressbar animate="false" value="currentUpload.value" type="success"><b>{{currentUpload.value}}%</b></progressbar>
            </div>
          </div>

          <div class="attachment-list">
            <a  ng-repeat="currentFile in newSharing.resource">
              <i class="fa fa-paperclip">{{ currentFile['origin_name'] }}</i>
            </a>
          </div>
        </div>

      </div>

      <div class="tag row">
        <label class="col col-lg-1 col-md-2 col-sm-2">标签:</label>
        <div class="right-tag col col-lg-10 col-md-9 col-sm-9">

          <!--为当前分享添加新的标签（可多个）-->
          <div class="tag-add">
            <div class="col col-xs-4">
              <select class="form-control tag-option"
                      ng-options="method.value as method.label for method in addTagMethods"
                      ng-model="addTagMethodValue"
                  >
              </select>
            </div>


            <div ng-switch on="addTagMethodValue">

              <div class="col col-xs-5" ng-switch-when="byUser">
                <input type="text" class="form-control" ng-model="$parent.addMixed"/>
              </div>

              <div class="col col-xs-5" ng-switch-when="inProject">
                <select class="form-control"
                        ng-model="$parent.addMixed"
                        ng-options="tag.id as tag.name for tag in projectTags"
                    >
                  <option value="">选择标签</option>
                </select>
              </div>

            </div>


            <div class="col col-xs-3">
              <button class="btn btn-info tag-add-button"
                      ng-click="addNewTag()">
                添加标签
              </button>
            </div>

          </div>
          <!--End of -- 为当前分享添加新的标签（可多个）-->

          <div class="label-list-box">
            <ul class="label-list" ng-show="hasAddTag">
              <li ng-repeat="(currentTagId, currentTag) in sharingTagSet">
                <span class="label-content" ng-bind="currentTag.name"></span>
                <button type="button" class="close close-button" ng-click="removeTag(currentTagId)" ><span>&times;</span></button>
              </li>
            </ul>

            <div ng-hide="hasAddTag">
              <p class="text-info text-center lead" style="margin-top: 1em">当前无添加标签</p>
            </div>
          </div>


        </div>

      </div>

      <div class="creating-submit text-center col-sm-offset-1">
        <button class="btn btn-primary" ng-click="addSharing()">确定</button>
        <button class="btn btn-warning">重置</button>
      </div>

    </div> <!--End of sharing-creating-content-->
  </div> <!--End of sharing-creating-container-->
    


</div>

